<template>
  <section class="component chart-date-select">
    <el-radio-group v-model="selectType" size="mini">
      <el-radio-button v-for="item of queryDateType" :key="item.value" :label="item.value">{{item.name}}</el-radio-button>
    </el-radio-group>
  </section>
</template>

<script lang="ts">
import Vue from "vue";
import { Component, Watch, Prop, Emit, Model } from "vue-property-decorator";
import { PaybackType, QueryDateType } from './dashboard.config';

@Component({
  components: {}
})
export default class ChartDateSelect extends Vue {
  private queryDateType: any[] = QueryDateType;

  @Model('on-datetype-change')
  private dateType: string;

  @Emit("on-datetype-change")
  private emitDateType(value: string) { }

  private get selectType() {
    return this.dateType
  }

  private set selectType(val) {
    this.emitDateType(val)
  }
}
</script>

<style lang="less">
.component.chart-date-select {
  .el-radio-group {
    .el-radio-button--mini {
      .el-radio-button__inner {
        padding: 6px 15px;
      }
    }
  }
}
</style>
